package b1.conifg
{
	public class AnimalConfig
	{
		//阵营：0, 龙; 1, 鸟; 2,怪物
		public var camp:int;
		//动物的构造类
		public var animalClass:String;
		//阵营内具体的种类: 0, 1, 2, ... 
		public var species:int;
		//所有动物的唯一索引
		public var index:int;
		//动物名字
		public var name:String;
		//描述文字
		public var description:String;
		//基础生命值
		public var baseHealthPoint:int;
		//基础智力值
		public var baseIntelligence:int;
		//每一个技能点增加的生命值 
		public var healthPointsPerSkillPoint:int;
		//每一个技能点增加的智力值
		public var intelligencePerSkillPoint:int;
		//基础速度
		public var baseSpeed:int;
		//每一个技能点增加的速度
		public var speedPerSkillPoint:Number;
		//基础体力值
		public var baseVitalityPoint:int;
		//每一个技能点增加的体力值
		public var vitalityPointsPerSkillPoint:int;
		//动物的所有线索
		public var animalClues:Object;
		//血量和体力恢复的速度
		public var regainRate:Number;
		//左侧动物手中骨头的位置
		public var leftXSite:int;
		
		public var leftYSite:int;
		
		public var leftRotation:int;
		//右侧动物手中骨头的位置
		public var rightXSite:int;
		
		public var rightYSite:int;
		
		public var rightRotation:int;
		
		public var boneWidth:int;
		
		public var boneHeight:int;
		//动物在Fight场景中的高度
		public var heightInFight:int;
		//动物在Home场景中的高度
		public var heightInHome:int;
		
		public function AnimalConfig(animalXML:XML)
		{
			baseHealthPoint = parseInt(animalXML.baseHealthPoint);
			baseSpeed = parseInt(animalXML.baseSpeed);
			baseIntelligence = parseInt(animalXML.baseIntelligence);
			baseVitalityPoint = parseInt(animalXML.baseVitalityPoint);
			camp = parseInt(animalXML.camp);
			animalClass = animalXML.animalClass;
			description = animalXML.description;
			index = parseInt(animalXML.index);
			name = animalXML.name;
			healthPointsPerSkillPoint = parseInt(animalXML.healthPointsPerSkillPoint);
			intelligencePerSkillPoint = parseInt(animalXML.intelligencePerSkillPoint);
			species = parseInt(animalXML.species);
			speedPerSkillPoint = parseFloat(animalXML.speedPerSkillPoint);
			vitalityPointsPerSkillPoint = parseInt(animalXML.vitalityPointsPerSkillPoint);
			regainRate = parseFloat(animalXML.regainRate);
			leftXSite = parseInt(animalXML.leftBoneSite.leftXSite);
			leftYSite = parseInt(animalXML.leftBoneSite.leftYSite);
			leftRotation = parseInt(animalXML.leftBoneSite.leftRotation);
			boneWidth = parseInt(animalXML.boneWidth);
			boneHeight = parseInt(animalXML.boneHeight);
			rightXSite = parseInt(animalXML.rightBoneSite.rightXSite);
			rightYSite = parseInt(animalXML.rightBoneSite.rightYSite);
			rightRotation = parseInt(animalXML.rightBoneSite.rightRotation);
			heightInFight = parseInt(animalXML.heightInFight);
			heightInHome = parseInt(animalXML.heightInHome);
			animalClues = new Object();
			for (var i:int = 0; i < animalXML.clue.length(); i++)
			{
				var animalClue:AnimalClueConfig = new AnimalClueConfig(animalXML.clue[i]);
				animalClues[animalClue.clueIndex] = animalClue;
			}
		}
		
	}
}